﻿/************************************************************************************
 * @author   wangjian
 *  碰撞监听
************************************************************************************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CollisionListener : MonoBehaviour {

	public delegate void collisionDelegate(Collision other);

	public collisionDelegate OnCollisionEnterCallBack;
	public collisionDelegate OnCollisionStayCallBack;
	public collisionDelegate OnCollisionExitCallBack;


	void OnCollisionEnter(Collision other){
		
		if (OnCollisionEnterCallBack != null)
			OnCollisionEnterCallBack (other);
	}

	void OnCollisionStay(Collision other){
		if (OnCollisionStayCallBack != null)
			OnCollisionStayCallBack (other);
	}

	void OnCollisionExit(Collision other){
		if (OnCollisionExitCallBack != null)
			OnCollisionExitCallBack (other);
	}
}
